package com.situ.mall.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.situ.mall.order.pojo.vo.OrderProductCount;
import com.situ.mall.pojo.entity.order.OrderItem;
import com.situ.mall.order.mapper.OrderItemMapper;
import com.situ.mall.order.service.IOrderItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单项信息 服务实现类
 * </p>
 *
 * @author Sun Huijuan
 * @since 2024-10-14
 */
@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements IOrderItemService {
	@Autowired
	private OrderItemMapper orderItemMapper;
	
	@Override
	public List<OrderItem> selectByOrderNo(String orderNo) {
		QueryWrapper<OrderItem> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("order_no", orderNo);
		return orderItemMapper.selectList(queryWrapper);
	}
	
	@Override
	public List<OrderProductCount> selectCategoryAmount() {
		return orderItemMapper.selectCategoryAmount();
	}
}
